<?php
/**
 * +----------------------------------------------------------------------
 * | MQTT服务控制器
 * +----------------------------------------------------------------------
 *                      _ooOoo_
 *                     o8888888o            | AUTHOR: 杜云
 *                     88" . "88            | EMAIL: 987772927@qq.com
 *                     (| -_- |)            | QQ: 987772927
 *                     O\  =  /O            | WECHAT: 987772927
 *                  ____/`---'\____
 *                .'  \\|     |//  `.
 *               /  \\|||  :  |||//  \
 *              /  _||||| -:- |||||-  \
 *              |   | \\\  -  /// |   |
 *              | \_|  ''\-/''  |   |
 *              \  .-\__  `-`  ___/-. /
 *            ___`. .'  /-.-\  `. . __
 *         ."" '<  `.___\_<|>_/___.'  >'"".
 *        | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 *        \  \ `-.   \_ __\ /__ _/   .-` /  /
 *   ======`-.____`-.___\_____/___.-`____.-'======
 *                      `=-='
 * +----------------------------------------------------------------------
 */
declare(strict_types=1);
namespace App\Controller\Server;

use Hyperf\HttpMessage\Server\Response;
use Hyperf\MqttServer\Annotation\MQTTConnect;
use Hyperf\MqttServer\Handler\HandlerInterface;
use Psr\Http\Message\ServerRequestInterface;

#[MQTTConnect(priority: 1)]
class MqttServerController implements HandlerInterface
{
    public function handle(ServerRequestInterface $request, Response $response): Response
    {
        var_dump((string) $request->getBody());
        return $response;
    }
}